function [integralApprox, eulerApprox] = testMonteCarlo(rngState)
% This function computes the approximation of a Stock price using two
% approximation techniques. The first is the integral approximation
% the second is the 

interestRate    = 0.06;
priceZero       = 100;
sigma           = 0.2;
T               = 1;
deltat          = 1 / 200;
N               = T / deltat;
type            = 'call';
strike			 = 99;

iter = 0;
for M = steps
	iter = iter + 1;
	randn('state', 2);
	for j = 1 : M
	    phi     = randn(N); 
	    integral = InitintegralMonteCarlo(interestRate, deltat, T, sigma, phi, priceZero);
	    if strcmp('call', type)
	        payoffintegral(j) = max(integral(N + 1) - strike, 0);
	    elseif strcmp('put', type)
	        payoffintegral(j) = max(strike - integral(N + 1), 0);
	    end
	end
	
	integralApprox(iter) = exp(-interestRate * T) * sum(payoffintegral) / M;
	
	randn('state', 2);
	for j = 1 : M
	    phi     = randn(N); 
	    recursive = InitrecursiveMonteCarlo(interestRate, deltat, T, sigma, phi, priceZero);
	    if strcmp('call', type)
	        payoffrecursive(j) = max(recursive(N + 1) - strike, 0);
	    elseif strcmp('put', type)
	        payoffrecursive(j) = max(priceZero - recursive(N + 1), 0);
	    end
	end
	
	eulerApprox(iter) = exp(-interestRate * T) * sum(payoffrecursive) / M;
end	

% vim: expandtab 

